﻿<Window x:Class="WpfWordsLearner.Views.ResultView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:conv="clr-namespace:WpfWordsLearner.Converters"
        Title="ResultView"
        Width="555"
        Height="350">
	<Grid>
		<Grid.Resources>
			<conv:BoolToImageConverter x:Key="converter" />
		</Grid.Resources>
		<DataGrid x:Name="dgrResults"
		          AutoGenerateColumns="False"
		          CanUserAddRows="False"
		          CanUserDeleteRows="False"
		          ItemsSource="{Binding Path=Result,
		                                Mode=TwoWay}"
		          SelectionMode="Single">
			<DataGrid.Columns>
				<DataGridTemplateColumn Width="60" Header="Success">
					<DataGridTemplateColumn.CellTemplate>
						<DataTemplate>
							<StackPanel>
								<Image x:Name="imgResult" Source="{Binding Path=IsCorrect, Converter={StaticResource converter}}" />
							</StackPanel>
						</DataTemplate>
					</DataGridTemplateColumn.CellTemplate>
				</DataGridTemplateColumn>
				<DataGridTextColumn Width="180"
				                    Binding="{Binding Path=Word.EnglishWord}"
				                    Header="English"
				                    IsReadOnly="True" />
				<DataGridTextColumn Width="250"
				                    Binding="{Binding Path=Word.Translate}"
				                    Header="Translate"
				                    IsReadOnly="True" />
			</DataGrid.Columns>
			<DataGrid.ContextMenu>
				<ContextMenu>
					<Separator />
					<MenuItem Click="MenuItem_Click"
					          Foreground="Black"
					          Header="Mark as complex" />
				</ContextMenu>
			</DataGrid.ContextMenu>
		</DataGrid>
	</Grid>
</Window>
